Skip to content

Treat scripts in R/ folder as collated - #1382

Merged
lionel- merged 2 commits into
mainfrom
oak-source/1-r-collation
Aug 5, 2026
Merged

Treat scripts in R/ folder as collated#1382
lionel- merged 2 commits into
mainfrom
oak-source/1-r-collation

Conversation

@lionel-

@lionel- lionel- commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Progress towards posit-dev/positron#14790
Progress towards #1338

Files in an R/ folder are now treated in an alphabetical collation, just like in packages. This means they can now see each other's functions.

The alphabetical order only matters for top-level expressions (eager context). For lazy contexts (like functions), the symbols resolve to the end-of-collation view, where all symbols from all files are defined.

Goals:

This is not technically needed for the targets::tar_source() use case which we will support with a more precise mechanism in subsequent PRs.

Note that while this allows files in the R/ folder to see each other, this has no effect at the sourcing site, e.g. tar_source(), or the implicit call to loadSupport() made by Shiny. This is a different side of the problem to be tackled separately.

Positron Release Notes

New Features

  • Files in an R/ folder are now implicitly treated in an alphabetical collation unless a more precise loading context is determined (go to definition returns no definition found positron#14790). Functions in sibling files can now see each other as long as they are in the same R/ folder. This currently only affects the symbol navigation and renaming features.

Bug Fixes

  • N/A

@lionel-
lionel- force-pushed the oak-source/1-r-collation branch 2 times, most recently from d5c46f2 to 1eea55a Compare August 3, 2026 13:17
@lionel-
lionel- force-pushed the oak-source/1-r-collation branch from 1eea55a to 6070b5b Compare August 3, 2026 16:18
Base automatically changed from oak-nse/22-diagnostics to main August 3, 2026 16:39
@lionel-
lionel- force-pushed the oak-source/1-r-collation branch 2 times, most recently from a81abca to 51ac90e Compare August 4, 2026 03:56
@lionel-
lionel- force-pushed the oak-source/1-r-collation branch from b31110d to cddcd5c Compare August 5, 2026 16:01
@lionel-
lionel- merged commit 06c1e7c into main Aug 5, 2026
17 checks passed
@lionel-
lionel- deleted the oak-source/1-r-collation branch August 5, 2026 17:17
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant